﻿using System.Configuration;

namespace Altairis.MailToolkit.Configuration {

    public class TemplateResourceElement : ConfigurationElement {

        /// <summary>
        /// Gets or sets the reource class type.
        /// </summary>
        /// <value>The resource class type.</value>
        [ConfigurationProperty("type", IsRequired = true)]
        public string Type {
            get { return (string)this["type"]; }
            set { this["type"] = value; }
        }

        /// <summary>
        /// Gets or sets resource key for the subject format.
        /// </summary>
        /// <value>The subject format resource key.</value>
        [ConfigurationProperty("subjectFormatKey", IsRequired = false, DefaultValue = "_SubjectFormat")]
        public string SubjectFormatKey {
            get { return (string)this["subjectFormatKey"]; }
            set { this["subjectFormatKey"] = value; }
        }

        /// <summary>
        /// Gets or sets resource key for the plain text body format.
        /// </summary>
        /// <value>The plain text body format resource key.</value>
        [ConfigurationProperty("bodyFormatKey", IsRequired = false, DefaultValue = "_BodyFormat")]
        public string BodyFormatKey {
            get { return (string)this["bodyFormatKey"]; }
            set { this["bodyFormatKey"] = value; }
        }

        /// <summary>
        /// Gets or sets resource key for the HTML body format.
        /// </summary>
        /// <value>The HTML body format resource key.</value>
        [ConfigurationProperty("htmlFormatKey", IsRequired = false, DefaultValue = "_HtmlFormat")]
        public string HtmlFormatKey {
            get { return (string)this["htmlFormatKey"]; }
            set { this["htmlFormatKey"] = value; }
        }

        /// <summary>
        /// Gets or sets the suffix for resource key specifying templated subject.
        /// </summary>
        /// <value>The subject format key suffix.</value>
        [ConfigurationProperty("subjectFormatSuffix", IsRequired = false, DefaultValue = "Subject")]
        public string SubjectFormatSuffix {
            get { return (string)this["subjectFormatSuffix"]; }
            set { this["subjectFormatSuffix"] = value; }
        }

        /// <summary>
        /// Gets or sets the suffix for resource key specifying templated plain text body.
        /// </summary>
        /// <value>The plain text body format key suffix.</value>
        [ConfigurationProperty("bodyFormatSuffix", IsRequired = false, DefaultValue = "Body")]
        public string BodyFormatSuffix {
            get { return (string)this["bodyFormatSuffix"]; }
            set { this["bodyFormatSuffix"] = value; }
        }

        /// <summary>
        /// Gets or sets the suffix for resource key specifying templated HTML body.
        /// </summary>
        /// <value>The HTML body format key suffix.</value>
        [ConfigurationProperty("htmlFormatSuffix", IsRequired = false, DefaultValue = "Html")]
        public string HtmlFormatSuffix {
            get { return (string)this["htmlFormatSuffix"]; }
            set { this["htmlFormatSuffix"] = value; }
        }
    }
}